package com.oplink.webems.modules.cfg.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.oplink.webems.common.persistence.BaseDao;
import com.oplink.webems.common.persistence.BaseDaoImpl;
import com.oplink.webems.modules.alarm.entity.AlarmSeverity;
import com.oplink.webems.modules.cfg.entity.CfgSlot;

/**
 * Configuration Slot Dao
 * @author yizhang
 */
public interface CfgSlotDao extends CfgSlotDaoCustom, CrudRepository<CfgSlot, Long> {

	@Query("from CfgSlot")
	public List<CfgSlot> findAllSlot();
	
	@Query("from CfgSlot where slotid=?2 and ne=?1")
	public List<CfgSlot> getCard(Long ne, Long slotid);
	
	
	@Query("from CfgSlot where ne=?1 and card is not null")
	public List<CfgSlot> getNotNullSlot(Long neid);
	
}

interface CfgSlotDaoCustom extends BaseDao<CfgSlot> {

}

@Component
class CfgSlotDaoImpl extends BaseDaoImpl<CfgSlot> implements CfgSlotDaoCustom {

}